package com.lonwin.inspectionmanagement.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lonwin.inspectionmanagement.R;
import com.lonwin.inspectionmanagement.app.utils.DataUtil;
import com.lonwin.inspectionmanagement.app.utils.TimeUtils;
import com.lonwin.inspectionmanagement.mvp.model.entity.bean.NoSortOutBean;
import com.lonwin.inspectionmanagement.mvp.ui.activity.CruiseLocusActivity;
import com.lonwin.inspectionmanagement.mvp.ui.activity.HomeActivity;

import java.util.List;

public class NoSortOutRecordItem2Adapter extends BaseQuickAdapter<NoSortOutBean.DataBean.RecordsBean.XcpathTempsBean,BaseViewHolder> {
    public NoSortOutRecordItem2Adapter(@Nullable List<NoSortOutBean.DataBean.RecordsBean.XcpathTempsBean> data) {
        super(R.layout.nosortout_record_item_item2,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoSortOutBean.DataBean.RecordsBean.XcpathTempsBean item) {
      helper.setText(R.id.nosortout_record_item_item2_startAdd,"起点："+(item.getStartaddr()==null?"--":item.getStartaddr()))
              .setText(R.id.nosortout_record_item_item2_endAdd,"终点："+(item.getEndaddr()==null?"--":item.getEndaddr()))
              .setText(R.id.nosortout_record_item_item2_time,TimeUtils.dateForStr(item.getEndtm()));
//              .setText(R.id.nosortout_record_item_item2_time,DataUtil.formtTime(Integer.parseInt(item.getTm())));
         helper.<TextView>getView(R.id.nosortout_record_item_item2_edit).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 CruiseLocusActivity.startCruiseLocusActivity(mContext,item.getGjid(),CruiseLocusActivity.Type.EDIT,"整理轨迹");                          }
         });

}
}
